<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <ul>
    <li>qwer</li>
  </ul>

  <script>
    var ul = document.querySelector('ul') 
    var libox = document.querySelector('li') 

    var li = document.createElement('li')

    li.innerText = '你真好'

    // ul.appendChild(li)  // 将li追加给 ul当子元素

    ul.insertBefore(li, libox)  // 将 li添加到 libox前边
  </script>
</body>
</html>